package com.tju.backend.plugin.web_socket;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.tio.core.ChannelContext;
import org.tio.core.TioConfig;
import org.tio.core.intf.Packet;
import org.tio.core.stat.IpStat;
import org.tio.core.stat.IpStatListener;

/**
 * WebSocket监听器
 *
 * @USER: CLS
 */
public class TioStatListener implements IpStatListener {
    @SuppressWarnings("unused")
    private static final Logger log = LoggerFactory.getLogger(TioStatListener.class);

    public static final TioStatListener me = new TioStatListener();

    /**
     *
     */
    private TioStatListener() {
    }

    /**
     * 在这里把统计数据入库中或日志
     *
     * @param tioConfig
     * @param ipStat
     */
    @Override
    public void onExpired(TioConfig tioConfig, IpStat ipStat) {
    }

    @Override
    public void onAfterConnected(ChannelContext channelContext, boolean isConnected, boolean isReconnect, IpStat ipStat) throws Exception {
    }

    @Override
    public void onDecodeError(ChannelContext channelContext, IpStat ipStat) {
    }

    @Override
    public void onAfterSent(ChannelContext channelContext, Packet packet, boolean isSentSuccess, IpStat ipStat) throws Exception {
    }

    @Override
    public void onAfterDecoded(ChannelContext channelContext, Packet packet, int packetSize, IpStat ipStat) throws Exception {
    }

    @Override
    public void onAfterReceivedBytes(ChannelContext channelContext, int receivedBytes, IpStat ipStat) throws Exception {
    }

    @Override
    public void onAfterHandled(ChannelContext channelContext, Packet packet, IpStat ipStat, long cost) throws Exception {
    }

}
